package ru.aslanov.schedule.server;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * Created: Feb 18, 2010 4:28:01 PM
 *
 * @author Sergey Aslanov
 */
public class CannotDeleteHasBackRefException extends Exception {
    private String message;

    public CannotDeleteHasBackRefException(List<BackReference> violatedBackRefs) {
        StringBuilder sb = new StringBuilder();
        for (BackReference violatedBackRef : violatedBackRefs) {
            if (sb.length() > 0) sb.append(", ");
            sb.append(violatedBackRef.getRefLocation());
        }
        this.message = sb.toString();
    }

    @Override
    public String getMessage() {
        return message;
    }
}
